home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17596 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.4 KB  |  46 lines

  1. Newsgroups: comp.lang.c++
  2. Path: in2.uu.net!world!mv!usenet
  3. From: ENGR@GSSI.MV.COM (Michael Furman)
  4. Subject: Re: Pure virtual destructors?
  5. Message-ID: <DpytLx.9qq@mv.mv.com>
  6. Mime-Version: 1.0
  7. Content-Type: Text/Plain; charset=US-ASCII
  8. Organization: GSSI
  9. Date: Tue, 16 Apr 1996 17:22:44 GMT
  10. References: <4kuq0i$p6t@ftp.ee.vill.edu>
  11. X-Newsreader: WinVN 0.99.7
  12. X-Nntp-Posting-Host: gssi.mv.com
  13.  
  14. In article <4kuq0i$p6t@ftp.ee.vill.edu>, sheridan@monet.vill.edu says...
  15. >
  16. >
  17. >The rule with destructors is that they are always overridden, right?
  18. >That's a quote from VC4 docs, BTW.  When I do this:
  19. >
  20. >class CBase {
  21. >public:
  22. >    virtual ~CBase() = 0;
  23. >...};
  24. >
  25. >class CChild : public CBase {
  26. >public:
  27. >    ~CChild();
  28. >...};
  29. >
  30. >and declare a body for ~CChild, I always get unresolved external on
  31. >CBase::~CBase.  I have seen this in several cases.  My guess is it's not
  32. >a compiler bug, so what am I missing?
  33.  
  34. You are missing the definition of CBase::~Cbase(). You must privide it
  35. even if destructor declared as pure virtual.
  36. -- 
  37. <<< If you received it by E-mail: it is a copy of post to the newsgroup 
  38. >>>
  39. ---------------------------------------------------------------
  40. Michael Furman,                       (603)893-1109
  41. Geophysical Survey Systems, Inc.  fax:(603)889-3984
  42. 13 Klein Drive - P.O. Box 97          engr@gssi.mv.com 
  43. North Salem, NH 03073-0097            71543.1334@compuserve.com
  44. ---------------------------------------------------------------
  45.  
  46.